import '../axis.dart';
import '../item_style.dart';
import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'gauge_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeEmphasis {
  ItemStyle? itemStyle;

  GaugeEmphasis({this.itemStyle});

  factory GaugeEmphasis.fromJson(Map<String, dynamic> json) =>
      _$GaugeEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeData {
  GaugeTitle? title;
  GaugeDetail? detail;
  var name;
  var value;
  ItemStyle? itemStyle;

  GaugeData({this.title, this.detail, this.name, this.value, this.itemStyle});

  factory GaugeData.fromJson(Map<String, dynamic> json) =>
      _$GaugeDataFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeProgress {
  var show;
  var overlap;
  var width;
  var roundCap;
  var clip;
  ItemStyle? itemStyle;

  GaugeProgress(
      {this.show,
      this.overlap,
      this.width,
      this.roundCap,
      this.clip,
      this.itemStyle});

  factory GaugeProgress.fromJson(Map<String, dynamic> json) =>
      _$GaugeProgressFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeProgressToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugePointer {
  var show;
  var icon;
  var offsetCenter;
  var length;
  var width;
  var keepAspect;
  ItemStyle? itemStyle;

  GaugePointer(
      {this.show,
      this.icon,
      this.offsetCenter,
      this.length,
      this.width,
      this.keepAspect,
      this.itemStyle});

  factory GaugePointer.fromJson(Map<String, dynamic> json) =>
      _$GaugePointerFromJson(json);

  Map<String, dynamic> toJson() => _$GaugePointerToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeAnchor {
  var show;
  var showAbove;
  var size;
  var icon;
  var offsetCenter;
  var keepAspect;
  ItemStyle? itemStyle;

  GaugeAnchor(
      {this.show,
      this.showAbove,
      this.size,
      this.icon,
      this.offsetCenter,
      this.keepAspect,
      this.itemStyle});

  factory GaugeAnchor.fromJson(Map<String, dynamic> json) =>
      _$GaugeAnchorFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeAnchorToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeTitle {
  var show;
  var offsetCenter;
  var color;
  var fontStyle;
  var fontWeight;
  var fontFamily;
  var fontSize;
  var lineHeight;
  var backgroundColor;
  var borderColor;
  var borderWidth;
  var borderType;
  var borderDashOffset;
  var borderRadius;
  var padding;
  var shadowColor;
  var shadowBlur;
  var shadowOffsetX;
  var shadowOffsetY;
  var width;
  var height;
  var textBorderColor;
  var textBorderWidth;

  var textBorderType;
  var textBorderDashOffset;
  var textShadowColor;
  var textShadowBlur;
  var textShadowOffsetX;
  var textShadowOffsetY;
  var overflow;
  var ellipsis;
  var lineOverflow;
  var rich;
  var valueAnimation;

  GaugeTitle(
      {this.show,
      this.offsetCenter,
      this.color,
      this.fontStyle,
      this.fontWeight,
      this.fontFamily,
      this.fontSize,
      this.lineHeight,
      this.backgroundColor,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.borderDashOffset,
      this.borderRadius,
      this.padding,
      this.shadowColor,
      this.shadowBlur,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.width,
      this.height,
      this.textBorderColor,
      this.textBorderWidth,
      this.textBorderType,
      this.textBorderDashOffset,
      this.textShadowColor,
      this.textShadowBlur,
      this.textShadowOffsetX,
      this.textShadowOffsetY,
      this.overflow,
      this.ellipsis,
      this.lineOverflow,
      this.rich,
      this.valueAnimation});

  factory GaugeTitle.fromJson(Map<String, dynamic> json) =>
      _$GaugeTitleFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeTitleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeDetail {
  var show;
  var color;
  var fontStyle;
  var fontWeight;
  var fontFamily;
  var fontSize;
  var lineHeight;
  var backgroundColor;
  var borderColor;
  var borderWidth;
  var borderType;
  var borderDashOffset;
  var borderRadius;
  var padding;
  var shadowColor;
  var shadowBlur;
  var shadowOffsetX;
  var shadowOffsetY;
  var width;
  var height;
  var textBorderColor;
  var textBorderWidth;
  var textBorderType;
  var textBorderDashOffset;
  var textShadowColor;
  var textShadowBlur;
  var textShadowOffsetX;
  var textShadowOffsetY;
  var overflow;
  var ellipsis;
  var lineOverflow;
  var rich;
  var valueAnimation;
  var offsetCenter;
  var formatter;

  GaugeDetail(
      {this.show,
      this.color,
      this.fontStyle,
      this.fontWeight,
      this.fontFamily,
      this.fontSize,
      this.lineHeight,
      this.backgroundColor,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.borderDashOffset,
      this.borderRadius,
      this.padding,
      this.shadowColor,
      this.shadowBlur,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.width,
      this.height,
      this.textBorderColor,
      this.textBorderWidth,
      this.textBorderType,
      this.textBorderDashOffset,
      this.textShadowColor,
      this.textShadowBlur,
      this.textShadowOffsetX,
      this.textShadowOffsetY,
      this.overflow,
      this.ellipsis,
      this.lineOverflow,
      this.rich,
      this.valueAnimation,
      this.offsetCenter,
      this.formatter});

  factory GaugeDetail.fromJson(Map<String, dynamic> json) =>
      _$GaugeDetailFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeDetailToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class GaugeSeries extends Series {
  var type = 'gauge';
  var id;
  var name;
  var zlevel;
  var z;
  var center;
  var radius;
  var legendHoverLink;
  var startAngle;
  var endAngle;
  var clockwise;
  List<GaugeData>? data;
  var min;
  var max;
  var splitNumber;
  AxisLine? axisLine;

  GaugeProgress? progress;

  SplitLine? splitLine;

  AxisTick? axisTick;

  AxisLabel? axisLabel;
  GaugePointer? pointer;

  GaugeAnchor? anchor;

  ItemStyle? itemStyle;

  GaugeEmphasis? emphasis;

  GaugeTitle? title;

  GaugeDetail? detail;

  MarkPoint? markPoint;
  MarkLine? markLine;
  MarkArea? markArea;
  var silent;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;
  Tooltip? tooltip;

  GaugeSeries(
      {this.id,
      this.name,
      this.zlevel,
      this.z,
      this.center,
      this.radius,
      this.legendHoverLink,
      this.startAngle,
      this.endAngle,
      this.clockwise,
      this.data,
      this.min,
      this.max,
      this.splitNumber,
      this.axisLine,
      this.progress,
      this.splitLine,
      this.axisTick,
      this.axisLabel,
      this.pointer,
      this.anchor,
      this.itemStyle,
      this.emphasis,
      this.title,
      this.detail,
      this.markPoint,
      this.markLine,
      this.markArea,
      this.silent,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate,
      this.tooltip});

  factory GaugeSeries.fromJson(Map<String, dynamic> json) =>
      _$GaugeSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$GaugeSeriesToJson(this);
}
